package mj.scott.back.paper.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import mj.scott.back.base.response.JsonResult;
import mj.scott.back.paper.pojo.dto.PaperQuery;
import mj.scott.back.paper.pojo.vo.PaperVO;
import mj.scott.back.paper.service.PaperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "试卷模块")
@Slf4j
@RequestMapping("/v1/paper/")
public class PaperController {
    @Autowired
    PaperService paperService;
    /**
     * 查询试卷列表
     */
    @Operation(summary = "查询试卷列表")
    @GetMapping("select")
    @ApiOperationSupport(order = 10)
    public JsonResult selectPaper(PaperQuery query){
        log.debug("【控制层】【查询试卷列表】{}",query);
        List<PaperVO> vo = paperService.selectPaper(query);
        return JsonResult.ok(vo);
    }
}
